from  machine import Pin
import time
from neopixel import NeoPixel

p38= Pin(2,Pin.OUT)
p45= Pin(45,Pin.OUT)
np=NeoPixel(p45,8)
np[0]=(255,0,0)
np.write()
np[2]=(0,255,0)
np.write()
np[1]=(0,0,255)
np.write()
np[7]=(255,255,0)
np.write()

red = (255,0,0)
orange = (255,128,0)
yellow = (255,255,0)
green = (0,255,0)
cyan = (0,255,255)
blue = (0,0,255)
violet = (255,0,255)
white = (255,255,255)
colors = (red,orange,yellow,green,cyan,blue,violet,white)

while True:
    p38.value(1)
    print("GPIO 381=",p38.value)
    time.sleep(1.5)
    p38.value(0)
    print("GPIO 382=",p38.value)
    time.sleep_ms(500)
    
    
    for color in colors:
        for i in range(8):
            np[i]=color
            np.write()
            time.sleep(0.5)
            np[i]=(0,0,0)
    
